package com.excilys.formation.project.webservices.converter;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import com.excilys.formation.project.dtos.OperationDTO;
import com.excilys.formation.project.entities.Operation;

@Component
public class Operation2OperationDTOConverter implements Converter<Operation, OperationDTO> {

	@Override
	public OperationDTO convert(Operation operation) {

		OperationDTO operationDTO = new OperationDTO();

		operationDTO.setMontant(operation.getMontant());
		operationDTO.setDate(operation.getDate());
		operationDTO.setDateEffet(operation.getDateEffet());
		operationDTO.setTypeOperation(operation.getTypeOperation());
		return operationDTO;
	}
}
